<?php
    define('KYOMINI_GO',true);	
    require_once('admin_conn.php');
	require_once ('../Config/conn.php"');
    session_start();

	
	$id=$_GET['id'];
    
	if ($_GET['id'] == '') {
                echo "没有数据";
				echo '<script>setTimeout(\'location="Article_list.php"\', 3000);</script>';
				exit;
            }
	$info=$db->select("article", array(
		"content",
		"title",
		"id",),
		 array(
		 "id" => $id
	));		


	
?>
    <!--嵌入页头文件-->
   <?php  include_once('Admin_header.php'); ?>
    <script charset="utf-8" src="<?php echo $EDITOR ?>kindeditor.js"></script>
    <script charset="utf-8" src="<?php echo $EDITOR ?>lang/zh_CN.js"></script>
<script>
        KindEditor.ready(function(K) {
                window.editor = K.create('#editor_id',{
					themeType : 'simple'
					});
        });
</script>


    <body>
<div id="container">
        <div id="main" role="main">
            <section id="intro">
              <h1>KyoMini PHP</h1>
              <p>欢迎你：<?php echo $_SESSION['username']; ?> | <a href="Article_list.php">列表</a> |<a href="Login_out.php"> 安全退出</a></p>
            </section>
            <hr>
            <section id="same-network">
            
             <?php foreach($info as $edit){ ?>
            
            
               <form method="POST" action="Article_mod.php">
                  <label for="textfield">文章标题:</label>
                  <input name="title" type="text" class="article a_input" value="<?php echo $edit['title']?>">
                  <label for="textfield">文章内容:</label>
                  <textarea rows="10" name="content" id="editor_id" class="article a_con"><?php echo $edit['content']?></textarea><br>

                  <input type="submit" name="submit" id="submit" value="修改" class="a_submit">
                  <input type="submit"id="submit" value="返回" class="a_submit" onclick="javascript:history.go(-1);">
                  <input type="hidden" name="id" value="<?php echo $edit['id']?>">
                </form>
                
                
                <?php } ?>  
            </section>
      </div>
</div>
</body>
</html>